Optimal. Leaf size=78 \[ \frac {3}{8} a x \left (a^2+b^2\right )+\frac {\sin ^4(c+d x) (a \cot (c+d x)+b)^3}{4 d}+\frac {3 a \sin ^2(c+d x) (a \cot (c+d x)+b) (a-b \cot (c+d x))}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3088, 805, 723, 203} \[ \frac {3}{8} a x \left (a^2+b^2\right )+\frac {\sin ^4(c+d x) (a \cot (c+d x)+b)^3}{4 d}+\frac {3 a \sin ^2(c+d x) (a \cot (c+d x)+b) (a-b \cot (c+d x))}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 723
Rule 805
Rule 3088
Rubi steps
\begin {align*} \int \cos (c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {x (b+a x)^3}{\left (1+x^2\right )^3} \, dx,x,\cot (c+d x)\right )}{d}\\ &=\frac {(b+a \cot (c+d x))^3 \sin ^4(c+d x)}{4 d}-\frac {(3 a) \operatorname {Subst}\left (\int \frac {(b+a x)^2}{\left (1+x^2\right )^2} \, dx,x,\cot (c+d x)\right )}{4 d}\\ &=\frac {3 a (b+a \cot (c+d x)) (a-b \cot (c+d x)) \sin ^2(c+d x)}{8 d}+\frac {(b+a \cot (c+d x))^3 \sin ^4(c+d x)}{4 d}-\frac {\left (3 a \left (a^2+b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (c+d x)\right )}{8 d}\\ &=\frac {3}{8} a \left (a^2+b^2\right ) x+\frac {3 a (b+a \cot (c+d x)) (a-b \cot (c+d x)) \sin ^2(c+d x)}{8 d}+\frac {(b+a \cot (c+d x))^3 \sin ^4(c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.39, size = 94, normalized size = 1.21 \[ \frac {8 a^3 \sin (2 (c+d x))-4 \left (3 a^2 b+b^3\right ) \cos (2 (c+d x))+\left (b^3-3 a^2 b\right ) \cos (4 (c+d x))+12 a \left (a^2+b^2\right ) (c+d x)+a \left (a^2-3 b^2\right ) \sin (4 (c+d x))}{32 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.69, size = 100, normalized size = 1.28 \[ -\frac {4 \, b^{3} \cos \left (d x + c\right )^{2} + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{4} - 3 \, {\left (a^{3} + a b^{2}\right )} d x - {\left (2 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (a^{3} + a b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.24, size = 104, normalized size = 1.33 \[ \frac {a^{3} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {3}{8} \, {\left (a^{3} + a b^{2}\right )} x - \frac {{\left (3 \, a^{2} b - b^{3}\right )} \cos \left (4 \, d x + 4 \, c\right )}{32 \, d} - \frac {{\left (3 \, a^{2} b + b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )}{8 \, d} + \frac {{\left (a^{3} - 3 \, a b^{2}\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.38, size = 114, normalized size = 1.46 \[ \frac {\frac {b^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{4}+3 b^{2} a \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {3 a^{2} b \left (\cos ^{4}\left (d x +c \right )\right )}{4}+a^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 91, normalized size = 1.17 \[ -\frac {24 \, a^{2} b \cos \left (d x + c\right )^{4} - 8 \, b^{3} \sin \left (d x + c\right )^{4} - {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{3} - 3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a b^{2}}{32 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.63, size = 281, normalized size = 3.60 \[ \frac {4\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,a\,b^2}{4}-\frac {5\,a^3}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {3\,a\,b^2}{4}-\frac {5\,a^3}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {21\,a\,b^2}{4}-\frac {3\,a^3}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {21\,a\,b^2}{4}-\frac {3\,a^3}{4}\right )+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {3\,a\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,\left (a^2+b^2\right )}{4\,d}+\frac {3\,a\,\mathrm {atan}\left (\frac {3\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2+b^2\right )}{4\,\left (\frac {3\,a^3}{4}+\frac {3\,a\,b^2}{4}\right )}\right )\,\left (a^2+b^2\right )}{4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.12, size = 272, normalized size = 3.49 \[ \begin {cases} \frac {3 a^{3} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a^{3} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 a^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {3 a^{2} b \cos ^{4}{\left (c + d x \right )}}{4 d} + \frac {3 a b^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a b^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 a b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {b^{3} \sin ^{4}{\left (c + d x \right )}}{4 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\relax (c )} + b \sin {\relax (c )}\right )^{3} \cos {\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________